<?php 
/*
 * homepage
*/
//check for a valid session
include("../inc_files/utils/checksession.php");
//include the page header
include("../inc_files/ui/header.php");?>
<title>Home</title>
<script type="text/javascript" src="../scripts/async.js"></script>
<script type='text/javascript'>
function refreshtsgrid(){
	var nochache = Math.floor(Math.random() * 10000);
	getasync('../timesheets/a_mytimesheets.php?dashboard=1' + nochache + '&amp;nocache=','timesheets', true);		
}
function refreshprojgrid(){
	var nochache = Math.floor(Math.random() * 10000);
	getasync('a_listprojects.php?&amp;nocache=' +
			 nochache,'projects', true);		
}
function createTimesheet(period){
	//post the data
	postasync('../timesheets/a_createtimesheet.php', 'value', 'period=' + period, false);
	refreshtsgrid();
}
</script>
</head>
<body>
	<?php 	include("../inc_files/ui/menu.php");?>
	<table>
		<tr>
			<td align="center" style="padding: 0px;">
				<table class="dashboard">

					<tr>
						<th class="dashboardth">My Timesheets</th>
						<th class="dashboardth">My Projects</th>
					</tr>

					<tr>
						<td class="dashboardtd">
							<div id="timesheets"
								style="position: relative; z-index: 2; width: 490px; height: 320px; overflow-x: hidden; overflow-y: scroll; border: 1px solid #E0E0E0;"></div>

						</td>
						<td class="dashboardtd">
							<div id="projects"
								style="position: relative; z-index: 2; width: 490px; height: 320px; overflow-x: hidden; overflow-y: scroll; border: 1px solid #E0E0E0;"></div>

						</td>
					</tr>
					<tr>
						<th colspan="2" class="dashboardth">Reports</th>

					</tr>
					<tr>
						<td class="dashboardtd">
							<table>
								<tr>
									<td style="padding: 20px;">Tabular report showing tasks, budget
										and timesheet records grouped by staff for each task. <br />
									</td>
								</tr>
								<tr>
									<td><a href="../reports/budgetreport.php"
										style="background-color: transparent;"><img
											src="../images/budget_report.png"
											alt="Tabular report showing tasks, budget
							and timesheet records"
											style="border: none" /> </a>
									</td>
								</tr>
							</table>


						</td>
						<td class="dashboardtd">
							<table>
								<tr>
									<td style="padding: 20px;">Project Gannt Chart report showing
										task progress and expenditure against budget for selected
										projects. <br />
									</td>
								</tr>
								<tr>
									<td><a href="../reports/gannt.php"
										style="background-color: transparent;"><img
											src="../images/gannt_report.png"
											alt="Project Gannt Chart report" style="border: none" /> </a>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	<?php
	//add the page footer
	include("../inc_files/ui/footer.php");?>
	<script type="text/javascript">	
	//populate the datagrids on page load
	refreshtsgrid();
	refreshprojgrid();	
	</script>

</body>
</html>
